﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ProjectWebNhac.DAO;
using System.Data;

namespace ProjectWebNhac.BUS
{
    public class PlaylistBus
    {
        public PlaylistBus() { }

        Dataprovider dao = new Dataprovider();

        public DataTable LayPlaylistTheoTaiKhoan(string TaiKhoan)
        {
            return dao.LayDuLieuThamSo("sp_User_LayPlayListTheoTaiKhoan",
               CommandType.StoredProcedure, new object[] { "@taikhoan", TaiKhoan });
        }
        public bool ThemBaiHatVaoPlayList(int MaPlayList, int MaBaiHat)
        {
            return dao.XuLySuKien("sp_User_ThemBHvaoPlaylist", CommandType.StoredProcedure,
                new object[] { "@MaPl", MaPlayList, "@MaBH", MaBaiHat });
        }
        public bool Taomoiplaylist(string taikhoan, string tenplaylist)
        {
            return dao.XuLySuKien("sp_User_TaoMoiPlaylist", CommandType.StoredProcedure,
                new object[] { "@taikhoan", taikhoan, "@TenPlaylist", tenplaylist });
        }
        public string GetMaxIDPlaylist()
        {
            return dao.LayDuLieuThamSo("sp_User_GetMaxIdPlaylist", CommandType.StoredProcedure).Rows[0][0].ToString();
        }
        public bool xoaplaylist( int Maplaylist)
        {
            return dao.XuLySuKien("sp_User_XoaPlaylist", CommandType.StoredProcedure,
                new object[] { "@Maplaylist", Maplaylist });
        }

        public DataTable LayDsBaiHatPlaylist(int MaPlaylist)
        {
            return dao.LayDuLieuThamSo("sp_User_LayDSBaiHatPlaylist",
               CommandType.StoredProcedure, new object[] { "@MaPlaylist", MaPlaylist });
        }

        public DataTable laythongtinplaylist(int MaPlaylist)
        {
            return dao.LayDuLieuThamSo("sp_User_LayThongTinPlaylist",
               CommandType.StoredProcedure, new object[] { "@MaPlaylist", MaPlaylist });
        }
    }
}